<template>
  <div>
    <p>{{ calacValue }}</p>
  </div>
</template>

<script>
export default {
  name: "ComputedDemo",
  data() {
    return {
      count: 0
    };
  },
  computed: {
    calacValue: {
      // get是默认的
      get() {
        return this.count + 1;
      },
      set(val) {
        console.log('val=', val);
      }
    }
  },
};
</script>

<style scoped></style>
